#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

class Date {
    int getMonthDay(int year, int month)
    {
        static int Day[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
        if (month == 2 && ((year % 4 == 0 && year % 100) || year % 400 == 0))
            return 29;
        return Day[month];
    }
public:
    Date(int y, int m, int d) :_year(y), _month(m), _day(d) {};
    Date& operator++()
    {
        _day++;
        int curMonthDay = getMonthDay(_year, _month);
        if (_day > curMonthDay)
        {
            _day -= curMonthDay;
            _month++;
            if (_month == 13)
            {
                _month = 1;
                _year++;
            }
        }
        return *this;
    }
    bool operator==(const Date& d) const { return _year == d._year && _month == d._month && _day == d._day; }
    bool operator!=(const Date& d) const { return !(*this == d); }
    int getYear() const { return _year; }
    int getMonth() const { return _month; }
    int getDay() const { return _day; }
private:
    int _year;
    int _month;
    int _day;
};

int CalDay(const Date& d1, const Date& d2) //d1:较小的日期赋给d1，d2:较大的日期
{
    Date tmp(d1);
    int ret = 0;
    while ((++tmp) != d2) ret++;
    return ret + 1;
}

int main() {
    int y1, m1, d1, y2, m2, d2;
    cin >> y1 >> m1 >> d1;
    cin >> y2 >> m2 >> d2;
    Date date1(y1, m1, d1);
    Date date2(y2, m2, d2);
    cout << CalDay(date1, date2);
    return 0;
}
